<?php

namespace App\Http\Controllers;

use App\Events\EventArticleViewed;
use App\Jobs\SendEmail;
use Illuminate\Http\Request;

class ArticleController extends Controller
{
    public function detail(Request $request, $id){

//        event(new EventArticleViewed($id));
        $this->dispatch(new SendEmail($id));
        $c = [1, 3, 5];
        $e = $this->add(...$c);

        return "You're viewing $e article ".$id;
    }

    private function add($a, $b){
        return $a+$b;
    }

}
